

export function setPosterInfo ({storeImg, goodsName, goodsImg, price, themeColor}) {
	const layoutObj = {
		css: {  // 背景图
			width: "460rpx",
			paddingBottom: "40rpx",
			background: themeColor,
			padding: '20rpx',
			boxSizing: 'border-box'
		},
		views: [
			{		// 商品名称
				type: "view",
				css: {
					width: '100%',
					paddingBottom: '20rpx',
					display: 'flex',
					alignItems: 'center',
					boxSizing: 'border-box'
				},
				views: [
					{		// 店铺图片
						src: storeImg,
						type: "image",
						css: {
							background: "#fff",
							objectFit: "cover",
							width: "84rpx",
							border: "2rpx solid #fff",
							boxSizing: "border-box",
							height: "84rpx",
							borderRadius: "50%"
						}
					},
					{		// 商品名称
						text: goodsName,
						type: "text",
						css: {
							flex: '1',
							paddingBottom: "10rpx",
							color: "#fff",
							fontSize: "26rpx",
							marginLeft: '20rpx',
							lineClamp: '2'
						}
					}
				]
			},
			{		// 商品图片容器
				type: "view",
				css: {
					width: '100%',
					paddingTop: '20rpx',
					paddingBottom: '20rpx',
					background: "#fff",
					display: 'flex',
					alignItems: 'center',
					justifyContent: 'space-between',
					padding: '20rpx',
					boxSizing: 'border-box',
					borderRadius: '10rpx'
				},
				views: [  
					{		// 容器左边图片
						src: goodsImg,
						type: "image",
						css: {
							width: '180rpx',
							height: '180rpx',
							objectFit: 'cover',
							borderRadius: '10rpx'
						}
					},
					{		// 容器右边价格和按钮
						type: "view",
						css: {
							height: '100%',
							textAlign: 'center'
						},
						views: [
							{		// 右边价格
								type: "view",
								css: {
									width: '100%',
									textAlign: 'center'
								},
								views: [
									{		// 右边价格￥
										type: "text",
										text: "￥",
										css: {
											textAlign: 'center',
											color: themeColor
										}
									},
									{		// 右边价格数字
										text: price,
										type: "text",
										css: {
											textAlign: 'center',
											color: themeColor
										}
									}
								]
							},
							{		// 右边按钮
								text: "立即购买",
								type: "text",
								css: {
									background: themeColor,
									width: '160rpx',
									height: '60rpx',
									color: "#fff",
									textAlign: 'center',
									borderRadius: '10rpx',
									marginTop: '20rpx'
								}
							}
						]
					}
				]
			}
		]
	}
	return layoutObj;
}